<template>
  <div id="app">
    <div id="nav">
      <router-link :to="{name: 'home'}">Home</router-link> |
      <router-link :to="{name: 'about'}">About</router-link> |
      <router-link :to="{name: 'countPage'}">Count</router-link> |
      <router-link :to="{name: 'splitPane'}">SplitPane</router-link>

    </div>
    <transition-group :name="routerTransition">
      <router-view key="default"/>
      <router-view key="email" name="email"/>
      <router-view key="tel" name="tel"/>
    </transition-group>
  </div>
</template>

<script>
export default {
  data () {
    return {
      routerTransition: ''
    }
  },
  watch: {
    '$route' (to) {
      to.query && to.query.transitionName && (this.routerTransition = to.query.transitionName)
    }
  }
}
</script>


<style lang="less">
@font-face{font-family:Barlow-Regular;src: url(https://s.ampmake.com/am/www/css/Barlow-Regular.woff2) format("woff2"),url(https://s.ampmake.com/am/www/css/Barlow-Regular.woff) format("woff")}

.router-enter {
  opacity: 0;
}
.router-enter-active {
  transition: opacity 1s ease
}
.router-enter-to {
  opacity: 1;
}

.router-leave {
  opacity: 1;
}
.router-leave-active {
  transition: opacity 1s ease
}
.router-leave-to {
  opacity: 0;
}

#app {
  font-family: Barlow-Regular, font-regular, "SF Pro SC", "SF Pro Display", "PingFang SC", "Segoe UI", "Helvetica Neue", "Helvetica", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
	color: #01204b;
	font-size: 16px;
	line-height: 28px;
}
#nav {
  padding: 30px;
  a {
    font-weight: bold;
    color: #2c3e50;
    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
